Import('env')

sources = Split("""
    IfaceConnection.cc
    Buddies.cc
    museekd.cc
    main.cc
""")


import os

env_museekd = Environment(**env._dict)
env_museekd.SConsignFile()


env_museekd.Prepend(LIBS = ['museek', 'museekal', 'muhelp', 'ucipher'])
museekd = env_museekd.Program(target = 'museekd', source = sources)


install = env_museekd.Install(env['DESTDIR'] + env['BINDIR'], [museekd])
manfile = ["museekd.1"]
man_install = env.Install(env['DESTDIR'] + env['MANDIR'], manfile)

env.Alias('install_museekd', man_install)
env.Alias('install_museekd', install)
env.Alias('install', 'install_museekd')

install_template = env_museekd.Install(env['DESTDIR'] + os.path.join(env['DATADIR'], 'museek', 'museekd'), ['config.xml.tmpl'])
env.Alias('install_template', install_template)
env.Alias('install', 'install_template')
